package com.ilife.web.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ilife.service.TestService;


/**
 * 测试demo控制器
 * @author wangtq
 * @date 2017/1/17
 */

@Controller
@RequestMapping("/test")
public class TestController {
	private  final Logger logger = LoggerFactory.getLogger("controller");
    @Autowired
    private TestService testService;

    /**
     * 测试方法
     * @param  type  
     * @return String
     */
    @RequestMapping(value = "/testMethod",method = RequestMethod.POST, produces={"application/json; charset=UTF-8"})
    @ResponseBody
    public String testMethod(@RequestParam(value = "type", required = true) String type,
    		String name) {
    	logger.info("====测试demo方法:type:{},name:{}",type,name);
    	String retStr = "aabb测试信息";
    	String str = testService.testMethod(type);
        return retStr;
    }

   
}
